<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 1.值是对象 -->
        <p style="background-color: rgb(201, 233, 245);font-size: 20px;">王俊凯18啦</p>
        <p :style="bgc">王源2022</p>
        <p :style="{fontSize: '100px', color: fontColor}">易烊千玺18</p>
        <!-- 2.值是数组 -->
        <p :style="[style1, style2]">张译30</p>
    </div>
    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el: "#app",  
            data() {
                return {
                    bgc: {
                        backgroundColor: '#ccc',
                        fontSize: '50px',
                    },
                    fontColor: 'orange',
                    style1: { color: "red" },
                    style2: { fontSize: "80px" },
                    style3: { fontStyle: "italic" },
                    style4: { textShadow: "1px 1px 2px green" },
                }
            },
            methods: {
                fn() {
                    
                }
            },
        })
</script>
</body>

</html> 